From 6a96cd8e91b5531037d42d2795a32c01ebc8aefc Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 21 Mar 2009 06:12:49 +0000 Subject: [PATCH] * Disabled one query for now since index is still pending * Removed duplicate expiry check * Tweaked editcount limit handling --- includes/specials/SpecialBlockip.php | 19 +++++++------------ languages/messages/MessagesEn.php | 1 + maintenance/language/messages.inc | 1 + 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/includes/specials/SpecialBlockip.php b/includes/specials/SpecialBlockip.php index 17d08af07a..3dbd0918d0 100644 --- a/includes/specials/SpecialBlockip.php +++ b/includes/specials/SpecialBlockip.php @@ -401,13 +401,12 @@ class IPBlockForm { } else if( $expiry !== 'infinity' ) { // Bad expiry. return array('ipb_expiry_temp'); + } else if( User::edits($userId) > 3000 ) { + // Typically, the user should have a handful of edits. + // Disallow hiding users with many edits for performance. + return array('ipb_hide_invalid'); } } - - if( $this->BlockHideName && $expiry != 'infinity' ) { - // Bad expiry. - return array('ipb_expiry_temp'); - } # Create block # Note: for a user block, ipb_address is only for display purposes @@ -499,11 +498,6 @@ class IPBlockForm { private function setUsernameBitfields( $name, $userId, $op ) { if( $op !== '|' && $op !== '&' ) return false; // sanity check - // Typically, the user should have a handful of edits. - // Disallow hiding users with many edits for performance. - if( User::edits($userId) > 3000 ) { - return false; - } $dbw = wfGetDB( DB_MASTER ); $delUser = Revision::DELETED_USER | Revision::DELETED_RESTRICTED; # To suppress, we OR the current bitfields with Revision::DELETED_USER @@ -528,8 +522,9 @@ class IPBlockForm { $dbw->update( 'oldimage', array("oi_deleted = oi_deleted $op $delUser"), array('oi_user_text' => $name), __METHOD__ ); # Hide name from deleted images - $dbw->update( 'filearchive', array("fa_deleted = fa_deleted $op $delUser"), - array('fa_user_text' => $name), __METHOD__ ); + # WMF - schema change pending + # $dbw->update( 'filearchive', array("fa_deleted = fa_deleted $op $delUser"), + # array('fa_user_text' => $name), __METHOD__ ); # Done! return true; } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 93bdb5dbdd..3430439697 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -2692,6 +2692,7 @@ See the [[Special:IPBlockList|IP block list]] for the list of currently operatio 'range_block_disabled' => 'The administrator ability to create range blocks is disabled.', 'ipb_expiry_invalid' => 'Expiry time invalid.', 'ipb_expiry_temp' => 'Hidden username blocks must be permanent.', +'ipb_hide_invalid' => 'Unable to suppress this account; it may have too many edits.', 'ipb_already_blocked' => '"$1" is already blocked', 'ipb-needreblock' => '== Already blocked == $1 is already blocked. Do you want to change the settings?', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 1450e0b339..fe07ca0df4 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1876,6 +1876,7 @@ $wgMessageStructure = array( 'range_block_disabled', 'ipb_expiry_invalid', 'ipb_expiry_temp', + 'ipb_hide_invalid', 'ipb_already_blocked', 'ipb-needreblock', 'ipb_cant_unblock', -- 2.20.1